package com.changgou.goods.feign;

import com.changgou.goods.pojo.Sku;
import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * SkuFeign
 */
@FeignClient(name = "goods")
@RequestMapping("/sku")
public interface SkuFeign {

    @GetMapping("/decr/{username}")
    Result decr(@PathVariable(value = "username") String username);

    /**
     * 获取列表的数据
     * @param status
     * @return
     */
    @RequestMapping("/findSkusByStatus/{status}")
    public Result<List<Sku>> findSkusByStatus(@PathVariable(value = "status") String status);

    /**
     * 查询库存信息
     * @param sku
     * @return
     */
    @PostMapping("/search")
    public Result<List<Sku>> findList(@RequestBody(required = false) Sku sku);

    /**
     * 获取库存信息
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    public Result<Sku> findById(@PathVariable("id") Long id);




}
